package com.surge;

import java.util.HashMap;
import java.util.Map;

public class StaticCarFactory {
	
	public static Map<String, Car> cars = new HashMap<String, Car>();
	
	static {
		
		cars.put("audi", new Car("audi","beijing",300000));
		cars.put("baoma", new Car("baoma","beijing",400000));
		
	}

	// 静态工厂方法 返回Car
	public static Car getCar(String name) {
		return cars.get(name);
	}
	
	
}
